import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import pandas as pd

# 超参：距离平均值的距离
hyperParameters=[2.5,100,5,2,2.5,  100,100,2.5,100,100,  2,100,100,100,0.08]


dataset = pd.read_csv('./ingotRate.csv')
data=dataset.iloc[:,:]
# X = dataset.iloc[:, :-1]
# y = dataset.iloc[:, dataset.shape[1] - 1]

mean_data=data.mean(axis=0)
# mean_X=X.mean(axis=0)
# mean_y=y.mean(axis=0)

print(mean_data)
# print(mean_X)
# print(mean_y)

# a=dataset.loc[0][:]
# print(dataset.loc[0][:])
# print(dataset.loc[0][0])

# dataset.loc[0][0]=0
# print(dataset.loc[0][0])

print("")

for i in range(dataset.shape[0]):
    for j in range(dataset.shape[1]-1):
        if abs(dataset.loc[i][j]-mean_data[j])>hyperParameters[j]:
            dataset.loc[i][j]=mean_data[j]

dataset.to_csv('./ingotRate_average.csv',index=None)








